package com.loveprogrammer.base.factory;

import org.springframework.context.ApplicationContext;

public class SpringContextHelper {

	private static ApplicationContext ac;

	public static void setApplicationContext(ApplicationContext ac) {

		SpringContextHelper.ac = ac;
	}

	public static ApplicationContext getContext() {

		return ac;
	}

	public static Object getBean(String name) {

		return ac.getBean(name);
	}

	public static Object getBean(Class clazz) {

		return ac.getBean(clazz);
	}

}
